package com.weight.common.generate.temple;

import java.util.List;
import java.util.Map;

import com.weight.common.generate.base.ResourceFile;


/**
* 
*  
*/
public class queryDetailHtmlResourceFile extends ResourceFile {
	private static final String FILE_NAME = ".html";
	
	public queryDetailHtmlResourceFile(String filePath,String packageName,String model,List<String> fieldENList,List<String> fieldCNList,String tableCnName) {
		
		super(filePath,new StringBuilder("queryFor").append(getModelClass(model)).append("Detail").append(FILE_NAME).toString());
		StringBuilder  resourceFile =new StringBuilder();
		
		resourceFile.append("<div th:id=\"'SS'+${formID}\" class=\"easyui-layout\"  style=\"padding:10px 20px 20px 20px;\">\n");
		resourceFile.append("\t<div>\n");
//		resourceFile.append("\t\t<table class=\"detailtable\"").append(" th:object=\"${").append(model).append("}\" > \n");
		resourceFile.append("\t\t<table class=\"detailtable\" > \n");
		for(int i=1;i<fieldENList.size();i++) {
			if(i%3==1) {
				if(i>1) {
					resourceFile.append("\t\t\t</tr>\n");
				}
				resourceFile.append("\t\t\t<tr>\n");
			}
			resourceFile.append("\t\t\t\t<th><span th:text=\" #{").append(fieldCNList.get(i)).append("}\"></span>  :</th>\n"); 
			resourceFile.append("\t\t\t\t<td><span th:text=\"${").append(model).append("?.").append(fieldENList.get(i)).append("}\"></span></td>\n"); 
		}
		resourceFile.append("\t\t\t</tr>\n");
		resourceFile.append("\t\t</table>\n");
		resourceFile.append("\t</div>\n");
		resourceFile.append("\n");  
		
		
		resourceFile.append("\t<div style=\"text-align:center;padding:20px;\">\n");
		resourceFile.append("\t\t<a href=\"javascript:void(0)\" class=\"easyui-linkbutton\" th:onclick=\"'javascript:cancelForm(\\''+${formID}+'\\')'\"  style=\"width:80px;\">关闭</a>\n");
		resourceFile.append("\t</div>\n");
		resourceFile.append("</div>\n");   
		
		
		resourceFile.append("<script type=\"text/javascript\">\n");
		resourceFile.append("</script>\n");
		resourceFile.append("\n");       
		resourceFile.append("\n");  
		
		resourceFile.append("\n");
		String resource = resourceFile.toString();
		init(resource);
	}
}
